<?php

/*
 * Action 4$
 * 
 * +1 card
 * +2 actions
 * When you trash this, put it into your hand.
 */

class Fortress extends Card implements iAction, iKingdom, iDarkAges {

    public function __construct() {
        parent::__construct("Fortress", 4);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+1 Card",
            "+2 Actions",
            "When you trash this, put it into your hand.");
    }

    public function trash(Game $game, $name) {
        $game->moveCardFromPileToPile($this, Trash, PlayHand, $name);
        ScreenDisplay::addScreenMessage($game, true, "put ".  nicePrint($this)." back in your hand", "put ".  nicePrint($this)." back in his hand", $name);
        $game->setTempCard($this);
        $game->cardTrashFinished($name);
    }

    public function play(Game $game, $isRealCard) {
        $drawed_cards = $game->drawCards(1);
        $game->addActions(2);
        ScreenDisplay::addScreenMessage($game, true, "get +2 actions  and draw " . nicePrint($drawed_cards), "get +2 actions and draws " . sizeof($drawed_cards) . " cards");
        $game->cardActionFinished();
        return true;
    }

}

?>